package com.zhaojindong.ioc.component.lifecycle.fourth;

import lombok.extern.log4j.Log4j;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * created by dean on 2018/8/20
 */
@Log4j
public class TestBean implements InitializingBean, DisposableBean {
    @Override
    public void afterPropertiesSet() {
        log.info(">>> InitializingBean afterPropertiesSet >>> ");
    }

    @Override
    public void destroy() {
        log.info(">>> DisposableBean destroy >>> ");
    }

    @PostConstruct
    public void init() {
        log.info(">>> PostConstruct init >>> ");
    }

    @PreDestroy
    public void destroy2() {
        log.info(">>> PreDestroy destroy >>> ");
    }

    public void init2() {
        log.info(">>> init-method init >>> ");
    }

    public void destroy3() {
        log.info(">>> destroy-method destroy>>> ");
    }
}